﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<List<SelectListItem>>" %>
<%if (Model.Count > 1)
  {%>
选择:<%=Html.DropDownList("currentCustom", this.Model, new { style = "width:200px;height:30px;" })%>
<script type="text/javascript">
    $(function () {
        $('#currentCustom').change(function () {
            $.post("/custom/ChangeCurrentCustomCode", "customcode=" + $('#currentCustom').val())
             .success(function (result) {
                 if (result.status == "success") {
                     window.location.reload();
                 }
                 else {
                     alert(result.msg);
                 }
             })
             .error(function (result) {
                 alert(result.statusText);
             })
        });
    });
</script>
<%}%>
<%if (Model.Count == 1)
  {
      Response.Write(string.Format("[{0}.{1}]", Model[0].Value, Model[0].Text));
  } %>